//
//  Public.h
//  私厨
//
//  Created by iMac on 16/2/27.
//
//

#ifndef ___Public_h
#define ___Public_h


//#define API_URL @"http://t.apishop.lianganyuchu.com"
#define API_URL @"http://apishop.lianganyuchu.com"

#define JPushAppKey @"927de88464840e4af5e2d551"

//系统颜色
#define MAIN_COLOR getUIColor(0xff2d4b)
#define ORANGE_COLOR getUIColor(0xfc9c6d)


#define WHITE_COLOR [UIColor whiteColor]

//字体颜色
#define LINE_COLOR getUIColor(0xdddddd)
#define LIGHT_COLOR getUIColor(0xdddddd)

#define BACK_COLOR getUIColor(0xf8f8f8)
#define LIGHT_COLOR getUIColor(0xdddddd)
#define DISABLE_COLOR getUIColor(0xcccccc)

#define TEXT_DEEP         getUIColor(0x333333)
#define TEXT_MIDDLE       getUIColor(0x666666)
#define TEXT_LIGHT        getUIColor(0x999999)
#define BLUE_COLOR        getUIColor(0x049bff)
#define GREEN_COLOR       getUIColor(0x6fc504)
#define RED_COLOR         getUIColor(0xff3f61)

/*****************************全局变量********************/
#define MODEL_VERSION [[UIDevice currentDevice].systemVersion floatValue]
#define IsIOS7 ([[[[UIDevice currentDevice] systemVersion] substringToIndex:1] intValue]>=7)
#define IsIOS8 ([[[[UIDevice currentDevice] systemVersion] substringToIndex:1] intValue]>=8)

#define iPhone4      ([UIScreen mainScreen].bounds.size.height == 480)
#define iPhone5      ([UIScreen mainScreen].bounds.size.height == 568)
#define iPhone6      ([UIScreen mainScreen].bounds.size.height == 667)
#define iPhone6P     ([UIScreen mainScreen].bounds.size.height == 736)

#define hScale ((kMainScreen_Height < 667) ? kMainScreen_Height/667 : 1)
#define wScale ((kMainScreen_Height < 375) ? kMainScreen_Height/375 : 1)
#define S(x) (x*hScale)

/********************ios的3.5，4.0适配操作***************************/
#define kMainScreen_Height [UIScreen mainScreen].bounds.size.height
#define kMainPage_Height [UIScreen mainScreen].bounds.size.height-65
#define kMainScreen_Width [UIScreen mainScreen].bounds.size.width
#define kMainScreen_Bounds CGRectMake(0.0f, 0.0f, kMainScreen_Width, kMainScreen_Height)
#define W(obj)   (!obj?0:(obj).frame.size.width)
#define H(obj)   (!obj?0:(obj).frame.size.height)
#define X(obj)   (!obj?0:(obj).frame.origin.x)
#define Y(obj)   (!obj?0:(obj).frame.origin.y)
#define XWW(obj) ((X(obj))+(W(obj)))
#define YHH(obj) ((Y(obj))+H((obj)))

//判断字符串是否为空
#define isNULL(object) (object== NULL||object==nil||[object isEqual:[NSNull null]])
#define Change(object) isNULL(object)?@"":object
#define isEmptyOrNULL(string) ( string== NULL || string == nil || [[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] isEqualToString:@""] || [string isEqual:[NSNull null]] || [string isEqualToString:@"<null>"])
#define img_placehold [UIImage imageNamed:@"placehold.png"]

#define kNAV_HEIGHT 64.0
#define kTAB_HEIGHT 50.0
#define kCellHeight 50.0
#define kDistance 15
#define kSmallDistance 10

#define Current_Version [[[NSBundle mainBundle] infoDictionary] objectForKey:(NSString *)kCFBundleVersionKey]

// 定义这个常量，就可以不用在开发过程中使用"mas_"前缀。
#define MAS_SHORTHAND
// 定义这个常量，就可以让Masonry帮我们自动把基础数据类型的数据，自动装箱为对象类型。
#define MAS_SHORTHAND_GLOBALS

#endif
















